﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Layout.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="NPMonitor.Web._Default" %>

<%@ Register Src="~/UserControls/MachineList.ascx" TagName="MachineList" TagPrefix="NPM" %>

<asp:Content ID="headerContent" runat="server" ContentPlaceHolderID="HeadContent">
    <script language="javascript" type="text/javascript">
        //以下是机器列表选中后，改变选中行的背景色、及刷新Job Schedule列表
        var prevselitem = null;
        function showJobList(tr,machineName,e) {
            var type = window.event.srcElement.tagName;
            //如果是a 连接，则返回
            if (type == "A" || type == "a")
                return;

            if (prevselitem != null) {
                $(prevselitem).removeClass("trBlueBackColor");
                $(tr).addClass("trBlueBackColor");
            }
            else {
                $(tr).addClass("trBlueBackColor");
            }
            prevselitem = tr;

            $("#<%=hfMachineId.ClientID %>").val(machineName);

            $('#ifJobScheduleList').attr("src", "JobScheduleList.aspx?MachineName=" + machineName);  
            return;
        }
    </script>
</asp:Content>
<asp:Content ID="bodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <div id="leftBar">
        <h2>
            Machine Pool</h2>
        <ul>
            <li class='<%=PoolId==""? "on":"" %>'><a href="Default.aspx" style="display: block;margin-top: -10px;line-height: 38px;width:190px;height: 38px;">All</a></li>
            <asp:Repeater ID="rpMachinePool" runat="server">
                <ItemTemplate>
                    <li <%#GetSelectItemClass(Eval("PoolId").ToString())%> ><a href='Default.aspx?poolId=<%#Eval("PoolId")%>' style="display: block;margin-top: -10px;line-height: 38px;width:190px;height: 38px;">
                        <%#Eval("PoolName") %></a></li>
                </ItemTemplate>
            </asp:Repeater>
        </ul>
        <div class="clear">
        </div>
    </div>
    <div id="rightBar">
        <div class="Tab">
            <NPM:MachineList ID="ucMachineList" runat="server" />
        </div>
        <iframe id="ifJobScheduleList" frameborder="0" src="JobScheduleList.aspx" style="width:100%;height:420px"></iframe>
    </div>
    <asp:HiddenField ID="hfMachineId" runat="server" Value="" />
</asp:Content>
